﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FourthWallProject.GameObjects.Solids;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace FourthWallProject.GameObjects.GameComponents
{
    public enum SolidState
    {
        Passable,
        Solid,
        Platform,
        End,
        Start
    }

    class StaticGameTile : StaticGameObject
    {
        public override void Draw(GameTime gameTime)
        {
            ScreenManager.SpriteBatch.Begin();
                ScreenManager.SpriteBatch.Draw(Texture, RectangleWithCameraOffset, Color);
            ScreenManager.SpriteBatch.End();
            base.Draw(gameTime);
        }

        public bool IsIntersected { get; set; }

        private float _friction;

        public StaticGameTile(Texture2D texture,Rectangle rectangle, Color color,SolidState state, Game game) :base (texture,rectangle,color,game)
        {
            this.Texture = texture;
            this.Color = color;
            _friction = 0.8f;
            this.SolidState = state;
            IsIntersected = false;
        }

        public SolidState SolidState { get; set; }

        public float Friction
        {
            get { return _friction; }
            set {
                if (value > 0 && value < 1)
                    _friction = value;
                else 
                    _friction = value > 1 ?  1 : 0; 
            }
        }
    }
}
